#!/bin/sh

_PID=$1
_TMP=/tmp/$_PID.tmp
touch $_TMP
echo 'TIME                VmRSS(kB)'
while true 
do
	if [ -f /proc/$_PID/status ]; then
		cat /proc/$_PID/status > $_TMP
		_VMRSS=`cat $_TMP | grep VmRSS | awk '{print $2}'`
		echo `date +"%Y-%m-%d %H:%M:%S"` ${_VMRSS}
	fi
	sleep 1
done

